<template>
  <div>
    <button v-for="tab in Tabs" :key="tab" @click="Tab=tab">{{ tab }}</button>
    <div v-if="Tab === 'tab1'">内容一</div>
    <div v-if="Tab === 'tab2'">内容二</div>
    <div v-if="Tab === 'tab3'">内容三</div>
  </div>
</template>

<script>
import { ref } from "vue";
export default {
  setup() {
    let Tab = ref("tab1");
    let Tabs = ["tab1", "tab2", "tab3"];
    return {
      Tab,
      Tabs,
    };
  },
};
</script>

<style lang="scss" scoped></style>
